home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
swagg_m.zip
/
KEYBOARD.SWG
/
0041_Getting Key Stats.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-08-27
|
1KB
|
71 lines
{ ROB PERELMAN }
Unit KeyStats;
Interface
Function RightShift : Boolean;
Function LeftShift : Boolean;
Function Control : Boolean;
Function Alt : Boolean;
Function ScrollLock : Boolean;
Function NumLock : Boolean;
Function CapsLock : Boolean;
Function Insert : Boolean;
Implementation
Uses
Dos;
Function ShiftState : Byte;
Var
Regs : Registers;
begin
Regs.Ah := 2;
Intr($16, Regs);
ShiftState := Regs.Al;
end;
Function RightShift : Boolean;
begin
RightShift := (ShiftState and 1) <> 0;
end;
Function LeftShift : Boolean;
begin
LeftShift := (ShiftState and 2) <> 0;
end;
Function Control : Boolean;
begin
Control := (ShiftState and 4) <> 0;
end;
Function Alt : Boolean;
begin
Alt := (ShiftState and 8) <> 0;
end;
Function ScrollLock : Boolean;
begin
ScrollLock := (ShiftState and 16) <> 0;
end;
Function NumLock : Boolean;
begin
NumLock := (ShiftState and 32) <> 0;
end;
Function CapsLock : Boolean;
begin
CapsLock := (ShiftState and 64) <> 0;
end;
Function Insert : Boolean;
begin
Insert := (ShiftState and 128) <> 0;
end;
end.